Radar Host Communication library  2020.08.13
COMPort.h
Go to the documentation of this file.
1 
16 /* ===========================================================================
17 ** Copyright (C) 2016-2020 Infineon Technologies AG
18 ** All rights reserved.
19 ** ===========================================================================
20 **
21 ** ===========================================================================
22 ** This document contains proprietary information of Infineon Technologies AG.
23 ** Passing on and copying of this document, and communication of its contents
24 ** is not permitted without Infineon's prior written authorisation.
25 ** ===========================================================================
26 */
27 
28 #ifndef COMPORT_H_INCLUDED
29 #define COMPORT_H_INCLUDED
30 
31 /*
32 ==============================================================================
33  1. INCLUDE FILES
34 ==============================================================================
35 */
36 #include <stddef.h>
37 #include <stdint.h>
38 
39 /* Enable C linkage if header is included in C++ files */
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif /* __cplusplus */
44 
45 #define IFX_RADAR_VID "058B"
46 #define IFX_RADAR_PID "0058"
47 
48 /* vendor id for form factor board */
49 #define IFX_RADAR_FF_PID "0250"
50 
51 typedef struct com_s com_t;
52 
53 /*
54 ==============================================================================
55  5. FUNCTION PROTOTYPES AND INLINE FUNCTIONS
56 ==============================================================================
57 */
79 uint32_t com_get_port_list(char* port_list, size_t buffer_size);
80 
94 com_t* com_open(const char* port_name);
95 
104 void com_close(com_t* com_port);
105 
120 size_t com_send_data(com_t* com_port, const void* data, size_t num_bytes);
121 
142 size_t com_get_data(com_t* com_port, void* data, size_t num_requested_bytes);
143 
157 void com_set_timeout(com_t* com_port, uint32_t timeout_period_ms);
158 
159 /* --- Close open blocks -------------------------------------------------- */
160 
161 /* Disable C linkage for C++ files */
162 #ifdef __cplusplus
163 } /* extern "C" */
164 #endif /* __cplusplus */
165 
166 /* End of include guard */
167 #endif /* COMPORT_H_INCLUDED */
168 
169 /* --- End of File -------------------------------------------------------- */
void com_set_timeout(com_t *com_port, uint32_t timeout_period_ms)
This function changes the timeout period of an open COM port.
size_t com_get_data(com_t *com_port, void *data, size_t num_requested_bytes)
This function reads data from an open COM port.
struct com_s com_t
Definition: COMPort.h:51
void com_close(com_t *com_port)
This function closes the specified COM port.
size_t com_send_data(com_t *com_port, const void *data, size_t num_bytes)
This function sends data through an open COM port.
com_t * com_open(const char *port_name)
This functions opens the specified COM port.
uint32_t com_get_port_list(char *port_list, size_t buffer_size)
This function returns a list of available COM ports.